# import json

import yaml


def by_path(past):
    """从文件地址获取文件内容"""
    with open(past, encoding="utf-8") as f:
        s = f.read()
        data_yaml = yaml.safe_load(s)
    return data_yaml

# with open("../data/data.json", "r", encoding="utf-8") as f:
#     data = f.read()
# json_data = json.loads(data)
# print(json_data)
# a = json_data[-1]
# print(a, type(a))
#
# with open("../data/data.yaml", "r", encoding="utf-8") as f:
#     data = f.read()
# yaml_data = yaml.safe_load(data)
# print(yaml_data)
# b = yaml_data[-1]
# print(b, type(b))
#
# print(json_data == yaml_data)
